package Datebase;

import Datebase.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URL;

public class datab extends JFrame{

    JFrame frame;
    JButton button1;
    JButton button2;
    public static void main(String[] args) {

        System.setProperty("sun.java2d.noddraw", "true");
        new datab();

    }
    public datab (){
        frame = new JFrame("学生成绩发布系统");
        //图标
        URL resource = datab.class.getClassLoader().getResource("kun.png");
        Image image = new ImageIcon(resource).getImage();
        frame.setIconImage(image);
        //窗口尺寸
        frame.setSize(400, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);

        JLabel tot = new JLabel("欢迎使用成绩发布系统");
        //tot.setForeground();
        tot.setFont(new Font("宋体", Font.PLAIN, 18));
        tot.setBounds(100,-20,300,80);
        frame.repaint();
        frame.add(tot);
        frame.setLayout(null);
        button1 = new JButton("教师登录");
        button1.setBounds(35,100,150,40);
        //监听器
        button1.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new tlogin();

            }
        });

        button1.setFont(new Font("微软雅黑", Font.PLAIN, 12));
        button2 = new JButton("学生登录");

        button2.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new slogin();
            }
        });
        button2.setBounds(200,100,150,40);
        button2.setFont(new Font("微软雅黑", Font.PLAIN, 12));

        frame.add(button1);
        frame.add(button2);
        frame.repaint();

    }


}
